package com.group9.handinhand.service.so;

import org.apache.commons.lang.ArrayUtils;

import com.group9.handinhand.dao.model.OfferResponse;
/**
 * Class for service of offer response.
 *
 */
public class OfferResponseSO extends AbstractBaseSO {
	
    private OfferSO offer;
	private UserSO user;
	private int respondAmount;
	/**
	 * converts to offer response model object
	 * @param ignoreProperties
	 * @return
	 */
	public OfferResponse convertToModelObject(String... ignoreProperties) {
		OfferResponse model = (OfferResponse) convert(new OfferResponse(),
				(String[]) ArrayUtils.addAll(ignoreProperties,new String[]{"request","user"}));
		model.setUser(this.user.convertToModelObject());
		model.setOffer(this.offer.convertToModelObject(new String[]{"moderators", "posts"}));
		return model;
	}

	public OfferSO getOffer() {
		return offer;
	}

	public void setOffer(OfferSO offer) {
		this.offer = offer;
	}

	public UserSO getUser() {
		return user;
	}

	public void setUser(UserSO user) {
		this.user = user;
	}

	public int getRespondAmount() {
		return respondAmount;
	}

	public void setRespondAmount(int respondAmount) {
		this.respondAmount = respondAmount;
	}

	@Override
	public String toString() {
		return "OfferResponseSO [offer=" + offer + ", user=" + user
				+ ", respondAmount=" + respondAmount + "]";
	}

	
}
